﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package org.aswing.plaf.basic {
    import org.aswing.*;
    import org.aswing.geom.*;
    import org.aswing.plaf.*;
    import org.aswing.graphics.*;

    public class BasicFrameTitleBarUI extends BaseComponentUI {

        protected var bar:FrameTitleBar;

        override public function installUI(_arg1:Component):void{
            this.bar = (_arg1 as FrameTitleBar);
            this.installDefaults();
            this.installComponent();
        }
        override public function uninstallUI(_arg1:Component):void{
            this.uninstallDefaults();
            this.uninstallComponent();
            this.bar = null;
        }
        protected function installDefaults():void{
            var _local1 = "FrameTitleBar.";
            LookAndFeel.installColorsAndFont(this.bar.getSelf(), _local1);
            LookAndFeel.installBorderAndBFDecorators(this.bar.getSelf(), _local1);
            LookAndFeel.installBasicProperties(this.bar.getSelf(), _local1);
        }
        protected function installComponent():void{
            if (this.bar.getIconifiedButton()){
                this.bar.getIconifiedButton().setIcon(getIcon("FrameTitleBar.iconifiedIcon"));
            };
            if (this.bar.getMaximizeButton()){
                this.bar.getMaximizeButton().setIcon(getIcon("FrameTitleBar.maximizeIcon"));
            };
            if (this.bar.getRestoreButton()){
                this.bar.getRestoreButton().setIcon(getIcon("FrameTitleBar.normalIcon"));
            };
            if (this.bar.getCloseButton()){
                this.bar.getCloseButton().setIcon(getIcon("FrameTitleBar.closeIcon"));
            };
            this.bar.setButtonIconGap(getInt("FrameTitleBar.buttonGap"));
            this.bar.setMinimizeHeight(getInt("FrameTitleBar.titleBarHeight"));
            this.bar.getSelf().revalidateIfNecessary();
        }
        protected function uninstallComponent():void{
        }
        protected function uninstallDefaults():void{
            LookAndFeel.uninstallBorderAndBFDecorators(this.bar.getSelf());
        }
        override public function paint(_arg1:Component, _arg2:Graphics2D, _arg3:IntRectangle):void{
            super.paint(_arg1, _arg2, _arg3);
            var _local4:ASColor = this.bar.getSelf().getForeground();
            var _local5:StyleResult = new StyleResult(_local4, this.bar.getSelf().getStyleTune());
            this.bar.getLabel().setForeground((this.bar.isActive()) ? _local5.bdark : _local5.blight);
            this.bar.getLabel().setFont(this.bar.getSelf().getFont());
            this.bar.getLabel().paintImmediately();
        }
        override protected function paintBackGround(_arg1:Component, _arg2:Graphics2D, _arg3:IntRectangle):void{
        }

    }
}//package org.aswing.plaf.basic 
